<template>
	<view class="bg-white" style="height: 100vh;">
		<cu-custom :bgColor="NavBarColor" :isBack="true" backFlag="navigate">
			<block slot="backText">返回</block>
			<block slot="content">详情</block>
		</cu-custom>
		<view>

			<view class=" text-df padding-left " style="color: #999;">

				<text class="" v-html="erpGoods.name">
				</text>
			</view>
			<view class="desc" style="font-family: '仿宋';font-size: 18px;">
				<view class="text-content padding" v-html="erpGoods.categoryName">
					<!-- <annotation-block :content="annotation.msgContent"/> -->
				</view>
			</view>
			<view class="padding flex flex-direction">
				<button class="cu-btn bg-blue lg"  @click="goGoodsList">提交</button>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				NavBarColor: this.NavBarColor,
				erpGoodsId: '',
				erpGoods: {
					code: '',
					name: '',
					noneSpec: '',
					categoryNo: '',
					categoryName: ''
				},
				goodNumber: null,
				flg: true,
				url: {
					getById: "/base/erpGoods/queryById",
				}

			}
		},
		onLoad:function(){
			console.log("this.$Route.query",this.$Route);
			let query = this.$Route.query
			if(query){
				this.annotation = query;
				}
		},
		onLoad: function(option) {
			const goods = JSON.parse(decodeURIComponent(option.item));
			console.log("code", goods.code)
			this.erpGoodsId = goods.id

		},
		created() {
			console.log("created");
			this.getById(this.erpGoodsId);
		},
		methods: {
			getById(id) {
				this.$http.get(this.url.getById, {
					params: {
						id: this.erpGoodsId
					}
				}).then(res => {
					//联网成功的回调,隐藏下拉刷新和上拉加载的状态;
					this.erpGoods = res.data.result
					console.log("entity", this.erpGoods)
					//设置列表数据
					if (res.data.success) {
						console.log("res", res.data)

					}


				})
			},

			numberPlus() {
				if (this.flg) {
					this.goodNumber++
					this.flg = false
				} else {
					this.goodNumber--
					if (this.goodNumber == 0) {
						this.goodNumber = null
					}
					this.flg = true
				}
			}
		}
	}
</script>

<style>
</style>